import request from '@/utils/request'

//获取-分页查询角色列表
export function getRoleList(params){
    return request({
        url:'/sys/role',
        params
    })
}
//添加角色
export function addRole(data){
    return request({
        url:'/sys/role',
        method:'post',
        data
    })
}
//更新角色
export function updateRole(data) {
    return request({
      url: `/sys/role/${data.id}`,
      method: 'put',
      data
    })
  }
//删除角色
export function deleteRole(id){
    return request({
        url:`/sys/role/${id}`,
        method:'delete'
    })
}
//查询角色详情
export function getRoleDetails(id){
    return request({
        url:`/sys/role/${id}`,
        method:'get',
    })
}
//跟新角色权限
export function updatePermission(data){
    return request({
        url: '/sys/role/assignPrem',
        method: 'put',
        data
      })
}

